<?php 
if(CHILDTEMPLATEPATH && file_exists(CHILDTEMPLATEPATH . '/normal_checkout_payment_begin.php'))
{
	include(CHILDTEMPLATEPATH . '/normal_checkout_payment_begin.php');
}
?>
 <?php
		$paymentsql = "select * from $wpdb->options where option_name like 'payment_method_%' order by option_id";
		$paymentinfo = $wpdb->get_results($paymentsql);
		if($paymentinfo)
		{
		?>
        <div>
  <div class="payment-list">
  <ul class="lists">
	<?php
			$paymentOptionArray = array();
			$paymethodKeyarray = array();
			foreach($paymentinfo as $paymentinfoObj)
			{
				$paymentInfo = unserialize($paymentinfoObj->option_value);
				if($paymentInfo['isactive'])
				{
					$paymethodKeyarray[] = $paymentInfo['key'];
					$paymentOptionArray[$paymentInfo['display_order']][] = $paymentInfo;
				}
			}
			ksort($paymentOptionArray);
			foreach($paymentOptionArray as $key=>$paymentInfoval)
			{
				for($i=0;$i<count($paymentInfoval);$i++)
				{
					$paymentInfo = $paymentInfoval[$i];
					//$jsfunction = 'onclick="showoptions(this.value);"';
					$chked = '';
					if($key==1)
					{
						$chked = 'checked="checked"';
					}
				?>
	<li>
	  <div class="row3" id="checkout_<?php echo $paymentInfo['key'];?>">
<input <?php //echo $jsfunction;?>  type="radio" value="<?php echo $paymentInfo['key'];?>" id="checkout_<?php echo $paymentInfo['key'];?>_id" name="paymentmethod" <?php echo $chked;?> /> <label for="checkout_<?php echo $paymentInfo['key'];?>_id"><?php echo $paymentInfo['name']?><span class="txt">Click here</span><span class="check"></span><span class="arrow"></span>
 <?php if($paymentInfo['payOpts'][0]['fieldname']=="addtional_charges"){?>
 <?php  $_SESSION['extraamt']= $paymentInfo['payOpts'][0]['value']; ?>
		<span class="hidden counter"><?php echo $paymentInfo['payOpts'][0]['value']; ?></span>  
		<?php }?>
</label></div>
<?php
					if(file_exists(TEMPLATEPATH.'/library/payment/'.$paymentInfo['key'].'/'.$paymentInfo['key'].'.php'))
					{
						include_once(TEMPLATEPATH.'/library/payment/'.$paymentInfo['key'].'/'.$paymentInfo['key'].'.php');
					}
				 ?>
           </li>
	  <?php
	  
				}
			}
			
		?>
		<?php 
if(CHILDTEMPLATEPATH && file_exists(CHILDTEMPLATEPATH . '/normal_checkout_payment_radio.php'))
{
	include(CHILDTEMPLATEPATH . '/normal_checkout_payment_radio.php');
}
?> 
		</ul>
  </div>
  <div class="payment-info-btm">
  <img src="<?php bloginfo('stylesheet_url') ?>/../images/netbanking.gif" alt="" />
  <img src="<?php bloginfo('stylesheet_url') ?>/../images/safe-secure-badge.png" alt=""/>
  </div>

  <?php
		}
		?>
<?php 
if(CHILDTEMPLATEPATH && file_exists(CHILDTEMPLATEPATH . '/normal_checkout_payment_end.php'))
{
	include(CHILDTEMPLATEPATH . '/normal_checkout_payment_end.php');
}
?>